package lab02.test06;

public class Ladder {
    //定义梯形的上底，下底，高以及面积
    double upperbase;
    double under;
    double high;
    double area;

    //无参的构造方法
    Ladder(){}
    //有参的构造方法
    Ladder(double upperbase,double under,double high){
        this.upperbase = upperbase;
        this.under = under;
        this.high = high;
    }
    //求面积
    double area(){
        area = (upperbase + under) * high / 2;
        return area;
    }
}
